#ifndef FOREST_INTERPRETER_H
#define FOREST_INTERPRETER_H
#include "forest.h"
#include "interpreter.h"

class ForestInterpreter : public Forest
{
public:
    ForestInterpreter(string input = DEFAULT_OUTPUT_FILE) : Forest(input) {};
    bool run() override;
};

bool ForestInterpreter::run()
{
    cout << "run in ForestInterpreter" << endl;
    Interpreter* interpreter = new Interpreter(input_file_name_);
    if (!interpreter->CheckAndResolve()) {
        exit(-1);
    }
    interpreter->Interpret();
    cout << "Forest finish interpret file " << input_file_name_ << endl;
}
#endif